<?php
class Image extends CI_Controller {
	function __construct() {
		parent::__construct ();
		$this->load->Model ( array ("CpyInfo", 'FolderManager', 'ImageManager', 'vo/Display_Item' ) );
	}
	
	function index($id) {
		
		$result = $this->ImageManager->getImageById ( $id );
		$vo ['type'] = $this->FolderManager->getChildFolder ( 1 );
		$vo ['title'] = 'OUTDOOR FURNITURE';
		$vo ['vo'] = $this->CpyInfo->getCpyInfoById ( 1 );
		
		if ($result) {
			$this->ImageManager->countVistCnt ( $id );
			$this->Display_Item = new Display_Item ( );
			$this->Display_Item->setName ( $result->getImageName () );
			$this->Display_Item->setId ( $result->getFunImageId () );
			$this->Display_Item->setIsFolder ( FALSE );
			$this->Display_Item->setDesc ( $result->getImageDesc () );
			$this->Display_Item->setUpTime ( $result->getImageUptime () );
			$this->Display_Item->setVisitCnt ( $result->getImageVicnt () );
			$this->Display_Item->setProductSize( $result->getProductSize () );
			$this->Display_Item->setThumbImage ( base_url () . "resources/images/funImg/" . $result->getImageTruUrl () );
			$this->Display_Item->setUrl ( base_url () . "resources/images/funImg/" . $result->getImageUrl () );
			
			$vo ['backUrl'] = base_url () . "folder/index/" . $result->getFolderId ();
			$vo ['data'] = $this->Display_Item;
			$vo ['images'] = $this->ImageManager->getImagesByFolderId ( $result->getFolderId () );
			$this->load->view ( 'display', $vo );
		} else {
			$vo ['backUrl'] = base_url ();
			$vo ['data'] = FALSE;
			$this->load->view ( 'display', $vo );
		}
	}

}

?>